package com.tansun.ruledata.data.entity;

import org.hibernate.validator.constraints.Length;

import com.tansun.easycare.core.persistence.BaseEntity;

/**
 * 规则引用数据Entity
 *
 * @author lixs
 * @version 2017-03-23
 */
public class DeployReferenceData extends BaseEntity {

    private static final long serialVersionUID = 1L;
    private String manageId;        // 规则管理ID
    private String modelType;        // 模型类型
    private String projectCode;        // 项目编号
    private String version;        // 版本
    private String className;        // 数据集名称
    private String classNamecn;
    private String code;
    private String namecn;        // 变量中文名称
    private String nameen;        // 变量英文名称
    private String dataType;        // 数据类型
    private String refManageId;        // 引用规则ID
    private String refVersion;        // 引用版本
    private String contentType;        // 操作类型;in 输入，out :输出

    private String defaultValue;

    private String isCollections;

    private String domain;

    private String pattern;

    private String domainStr;

    private String isDerives;

    private Integer seq;

    private String refName;
    private String enterPointer;//关联调用编码
    public DeployReferenceData() {
        super();
    }

    public DeployReferenceData(String id) {
        super(id);
    }

    @Length(min = 0, max = 64, message = "规则管理ID长度必须介于 0 和 64 之间")
    public String getManageId() {
        return manageId;
    }

    public void setManageId(String manageId) {
        this.manageId = manageId;
    }

    @Length(min = 0, max = 10, message = "模型类型长度必须介于 0 和 10 之间")
    public String getModelType() {
        return modelType;
    }

    public void setModelType(String modelType) {
        this.modelType = modelType;
    }

    @Length(min = 0, max = 64, message = "项目编号长度必须介于 0 和 64 之间")
    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }


    @Length(min = 0, max = 10, message = "版本长度必须介于 0 和 10 之间")
    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @Length(min = 0, max = 64, message = "数据集名称长度必须介于 0 和 64 之间")
    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    @Length(min = 0, max = 64, message = "变量中文名称长度必须介于 0 和 64 之间")
    public String getNamecn() {
        return namecn;
    }

    public void setNamecn(String namecn) {
        this.namecn = namecn;
    }

    @Length(min = 0, max = 64, message = "变量英文名称长度必须介于 0 和 64 之间")
    public String getNameen() {
        return nameen;
    }

    public void setNameen(String nameen) {
        this.nameen = nameen;
    }

    @Length(min = 0, max = 64, message = "数据类型长度必须介于 0 和 64 之间")
    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    @Length(min = 0, max = 64, message = "引用规则ID长度必须介于 0 和 64 之间")
    public String getRefManageId() {
        return refManageId;
    }

    public void setRefManageId(String refManageId) {
        this.refManageId = refManageId;
    }

    @Length(min = 0, max = 10, message = "引用版本长度必须介于 0 和 10 之间")
    public String getRefVersion() {
        return refVersion;
    }

    public void setRefVersion(String refVersion) {
        this.refVersion = refVersion;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public String getClassNamecn() {
        return classNamecn;
    }

    public void setClassNamecn(String classNamecn) {
        this.classNamecn = classNamecn;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public String getIsCollections() {
        return isCollections;
    }

    public void setIsCollections(String isCollections) {
        this.isCollections = isCollections;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getPattern() {
        return pattern;
    }

    public void setPattern(String pattern) {
        this.pattern = pattern;
    }

    public String getDomainStr() {
        return domainStr;
    }

    public void setDomainStr(String domainStr) {
        this.domainStr = domainStr;
    }

    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public String getIsDerives() {
        return isDerives;
    }

    public void setIsDerives(String isDerives) {
        this.isDerives = isDerives;
    }

    public String getRefName() {
        return refName;
    }

    public void setRefName(String refName) {
        this.refName = refName;
    }
    
	public String getEnterPointer() {
		return enterPointer;
	}

	public void setEnterPointer(String enterPointer) {
		this.enterPointer = enterPointer;
	}

	public String getSql() {
		return "INSERT INTO rule_reference_data(id,manage_id,model_type,project_code,code,version,class_name,namecn,nameen,data_type,ref_manage_id,ref_version,content_type,seq,enter_pointer,data_version) "
				+ "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	}
	
	public String getExeSql() {
		return "INSERT INTO rule_exe_reference_data(id,manage_id,model_type,project_code,code,version,class_name,namecn,nameen,data_type,ref_manage_id,ref_version,content_type,seq,enter_pointer,data_version) "
				+ "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	}
	
	public Object[] getArgs(String timeStamp) {
		return new Object[] {this.id,this.manageId,this.modelType,this.projectCode,this.code,this.version,this.className,this.namecn,this.nameen,this.dataType,this.refManageId,this.refVersion,this.contentType,this.seq,this.enterPointer,timeStamp};
	}
}